<script setup>
	import {
		shallowRef
	} from 'vue'
	import ComA from './ComA.vue'
	import ComB from './ComB.vue'

	const current = shallowRef(ComA)
</script>

<template>
	<div class="demo">
		<label><input type="radio" v-model="current" :value="ComA" /> A</label>
		<label><input type="radio" v-model="current" :value="ComB" /> B</label>
		<KeepAlive>
			<component :is="current"></component>
		</KeepAlive>
	</div>
</template>